package org.yx.service.smat.view_material_sn;

import org.dbist.dml.Page;
import org.dbist.dml.Query;
import org.yx.utils.BaseService;

/**
 * 查询物料批次信息
 * @author zxw
 * @since 2018/05/20
**/
public class SmatViewMaterialSnService extends BaseService {
	public SmatViewMaterialSnOut viewMaterialSn(SmatViewMaterialSnIn in) throws Exception {
		Query query = new Query(in.getPageIndex(),in.getPageSize());
		query.addFilter("orgCode",in.getUserOrgCode());
		query.addFilter("msn",in.getMsn());
		query.addFilter("matCode",in.getMatCode());
		query.addFilter("matVer",in.getMatVer());
		query.addFilter("whCode",in.getWhCode());
		
		Page<MatMsn> msnPage = selectPageBySqlFilePath("select_material_sn.sql", query, MatMsn.class);
		
		SmatViewMaterialSnOut out = new SmatViewMaterialSnOut();
		out.setMsnList(msnPage.getList());
		out.setTotalSize(msnPage.getTotalSize());

		return out;
	}
}